//
//  ICMActivityModel.m
//  ICrEAM
//
//  Created by rainimute on 16/11/9.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "ICMActivityModel.h"
#import "ICMAppointmentActivityView.h"
#import "ICMSelecteActivityView.h"

@implementation ICMActivityModel

- (void)setupActivityModelWithSelecteView:(ICMSelecteActivityView *)activityView{
    self.TT_RECPTION_ACTIVITY = activityView.selectedActivitys;
}

- (void)createActivityItemModel{
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in self.TT_RECPTION_ACTIVITY) {
        ICMActivityItemModel *model = [ICMActivityItemModel yy_modelWithDictionary:dic];
        [array PACA_AddObject:model];
    }
    self.TT_RECPTION_ACTIVITY = array;
}

- (void)createActivityItemBookingModel{
    NSMutableArray *array = [NSMutableArray array];
    for (NSDictionary *dic in self.TT_ACTIVITY) {
        ICMActivityItemModel *model = [ICMActivityItemModel yy_modelWithDictionary:dic];
        [array PACA_AddObject:model];
    }
    self.TT_ACTIVITY = array;
}

@end


@implementation ICMActivityItemModel

- (void)setupActivityItemModelWithAppointmentActivityView:(ICMAppointmentActivityView *)activityView{
    NSMutableArray *activityCodes = [NSMutableArray array];
    for (ICMActivityItemModel *itemModel in activityView.selectedActivitys) {
        [activityCodes PACA_AddObject:itemModel.ACTIVITY_CODE];
    }
    self.ACTIVITY_CODE = [activityCodes componentsJoinedByString:@";"];
}

@end
